package LinerSearch;

import java.util.Random;

/**
 * @ClassName: LinerSearch.ArrayGenerator
 * @Description: TODO
 * @Author: LiangPengFei
 * @Date: 2021/1/4 23:27
 * @Version: 1.0
 **/
public class ArrayGenerator {
    private ArrayGenerator(){}
    public static Integer[] generateOrderedArray(int n){
        Integer[] arr = new Integer[n];
        for(int i=0;i<arr.length;i++){
            arr[i]=i;
        }
        return arr;
    }

    public static Integer[] generateRandomArray(int n ,int bound){
        Integer[] arr = new Integer[n];
        Random random = new Random();
        for (int i=0;i<n;i++){
            arr[i] = random.nextInt(bound);
        }
        return arr;
    }
}
